{%extends 'base_right.html'%}
{% load blog_tags %}

{% block description %}
    <meta name="description" content="{% get_title category as c %}{{ c.description }}"/>
{% endblock description %}
{% block keywords %}
    <meta name="keywords" content="{% get_title category as c %}{{ c.keywords }}"/>
{% endblock keywords %}
{% block title %}{% get_title category as c %}甫式人生丨{{ c.name }}{% endblock title %}

{% block body %}
    <div class="content-wrap">
        <div class="content">
            <header class="archive-header">
                <h1><i class="fa fa-folder-open"></i>  &nbsp;分类：{{ category }}
                    <a title="订阅福利专区" target="_blank" href="{% url 'blog:category' resources '' %}"><i class="rss fa fa-rss"></i></a>
                </h1>
            </header>
            {% for article in page_obj %}
            <article class="excerpt">
                <header>
                    <a class="label label-important" href="/category/{{ article.category.bigcategory.name }}/{{ article.category.name|lower }}">{{ article.category.name }}<i class="label-arrow"></i></a>
                    <h2><a target="_blank" href="/article/{{ article.slug }}" title="{{ article.title }}">{{ article.title }} </a></h2>
                </header>
                <div class="focus"><a target="_blank" href="/article/{{ article.slug }}">
                    <img class="thumb" width="200" height="123" src="{{ article.img_link }}" alt="{{ article.title }}" /></a>
                </div>
                <span class="note"> {{ article.summary }}</span>
                <p class="auth-span">
                    <span class="muted"><i class="fa fa-user"></i> <a href="/author/{{ article.author }}">{{ article.author }}</a></span>
                    <span class="muted"><i class="fa fa-clock-o"></i> {{ article.create_date|date:'Y-m-d'}}</span>
                    <span class="muted"><i class="fa fa-eye"></i> {{ article.views }}浏览</span>
                    <span class="muted"><i class="fa fa-comments-o"></i>
                        <a target="_blank" href="/article/{{ article.slug }}#comments">评论</a></span>
                    <span class="muted"><a href="javascript:;" data-action="ding" data-id="455" id="Addlike" class="action">
                        <i class="fa fa-heart-o"></i><span class="count">{{ article.love }}</span>喜欢</a>
                    </span>
                </p>
            </article>
        {% empty %}
                <div class="no-post">当前分类下还没有发布的文章！</div>
        {% endfor %}
        {% if is_paginated %}
            <div class="pagination">
                <ul>
                    {% if first %}
                        <li><a href="?page=1">1</a></li>
                    {% endif %}
                    {% if left %}
                        {% if left_has_more %}
                            <li><span>...</span></li>
                        {% endif %}
                        {% for i in left %}
                            <li class="prev-page"><a href="?page={{ i }}">{{ i }}</a></li>
                        {% endfor %}
                    {% endif %}
                    <li class="active"><a href="?page={{ page_obj.number }}">{{ page_obj.number }}</a></li>
                    {% if right %}
                        {% for i in right %}
                            <li class="next-page"><a href="?page={{ i }}">{{ i }}</a></li>
                        {% endfor %}
                        {% if right_has_more %}
                            <li><span>...</span></li>
                        {% endif %}
                    {% endif %}
                    {% if last %}
                        <li><a href="?page={{ paginator.num_pages }}">{{ paginator.num_pages }}</a></li>
                    {% endif %}
                </ul>
            </div>
        {% endif %}
        </div>
    </div>
{%endblock body%}